<template>
  <view class="swiper-box">
  	<swiper class="swiper">
  		<swiper-item class="swiper-item" v-for="(item,index) in swiperList" :key="index">
  			<image class="havedata" :src="item.src" v-if="item.src"></image>
  			<!-- 默认图片 -->
  			<image class="nodata" src="../../static/logo.png" v-else></image>
  		</swiper-item>
  	</swiper>
  </view>
</template>

<script>
export default {
  data() {
    return {
      swiperList: [{
      		name: 1,
      		src: '../static/logo.png'
      	},
      	{
      		name: 2,
      		src: '../static/logo.png'
      	}
      ]
    };
  }
};
</script>

<style scoped lang="scss">
.swiper-box {
		width: 100%;
		height: 300rpx;

		.swiper {
			width: 100%;
			height: 100%;

			.swiper-item {
				width: 100%;
				height: 100%;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
</style>